﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Microsoft.Xna.Framework;

namespace MenuGame2DXNA
{
    public class Utilities
    {
        
        private static Vector2 cellSize = new Vector2(50, 50);
        /// <summary>
        /// Index2s the pixel.
        /// </summary>
        /// <param name="p">The p.</param>
        /// <returns></returns>
        public static Vector2 Index2Pixel(Point p)
        {
            return new Vector2(p.Y * cellSize.X , p.X * cellSize.Y );
        }
        /// <summary>
        /// Pixel2s the index.
        /// </summary>
        /// <param name="p">The p.</param>
        /// <returns></returns>
        public static Point Pixel2Index(Vector2 p)
        {
            return new Point((int)p.Y / (int)cellSize.X, (int)p.X / (int)cellSize.Y);
        }
        
    }
}
